|
|
|
◆ シェルスクリプトの実行 ◆
cシェル等を実行する際に、./test.sh等とシェルスクリプトの前に./(コロンとスラッシュ)を付けます。
例えばシェルの中身が
[ora817@localhost tools]$ more test.sh
echo "hell world"
の場合、実行する時に、
[ora817@localhost tools]$ ./test.sh
hell world
とします。
この時、./が無いと、
[ora817@localhost tools]$ test.sh
test.sh: コマンドが見つかりません.
等とエラーが表示されます。
しかし、いちいち./等と指定することが面倒な場合があります。
こんな時は、サーチパスにカレントディレクトリを含めておけばシェル名だけで実行できます。
具体的には、
[ora817@localhost tools]$ set path = ($path ./)
[ora817@localhost tools]$ test.sh
hell world
[ora817@localhost tools]$
とすればシェル名のみで実行できます。
今使っているシェルをcシェルに変更したい場合は、
[ora817@localhost tools]$csh
と入力します。 |